#!/bin/bash
cp ./gulpfile.js ../
cp ./server.js ../
cp ./package.json ../
cd ../

project="shframeworkseed"
dev="/bin/dev.zip"
dest="/bin/html.zip"
ip="10.0.154.37"

if [ $# -eq 1 ];then
   if [ "$1" = "node" ];then
        echo "start node server..."
        supervisor server.js

   elif [ "$1" = "tree" ];then
        tree "$project" -L 2

   elif [ "$1" = "size" ];then
        #stat -c "%n:%s" "$path"
        du -x ${project}${dest}
        du -x ${project}${dev}

   elif [ "$1" = "adb" ];then
        adb connect ${ip}cp 

   elif [ "$1" = "pub" ];then
        du -x ${project}${dest}
        du -x ${project}${dev}
        echo copy going..................
        cp /home/huangjian/workstation/bridge/shframeworkseed/html/** -vur  /home/huangjian/workstation/smc-portal-wap/WebContent/active/33
        cp /home/huangjian/workstation/bridge/shframeworkseed/bin  /home/huangjian/workstation/smc-portal-wap/WebContent/active/33 -r
        echo copy end..................

   else
        echo "tasking $1:"
        gulp $1 -debug
   fi
else
    echo "tasking default:"
    gulp -debug
fi